﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using ProgNetComponentsDx.Base.Classes;
using ProgNetComponents.Design.Attributes;

namespace ProgNetComponentsDx.GridTools
{
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class GridToolsSettings : BaseSettings
    {
        public GridToolsSettings(object target, GridToolsProvider provider) :
            base(target, provider)
        {
            ExportSettings = new ExportSettings();
            AddExportMenu = true;
            FileName = "dane";
        }

        [AlwaysSerialize]
        public bool AddExportMenu
        {
            get;
            set;
        }

        [BrowsableByPropertyValue("AddExportMenu", true),
        DefaultValue("dane")]
        public string FileName
        {
            get;
            set;
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
        BrowsableByPropertyValue("AddExportMenu", true)]
        public ExportSettings ExportSettings
        {
            get;
            private set;
        }
    }

    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class ExportSettings
    {
        public ExportSettings()
        {
            this.ExportToHtml = true;
            this.ExportToPdf = true;
            this.ExportToXls = true;
            this.ExportToXlsx = true;
        }

        [NotifyParentProperty(true),
        DefaultValue(true)]
        public bool ExportToXls { get; set; }

        [NotifyParentProperty(true),
        DefaultValue(true)]
        public bool ExportToXlsx { get; set; }

        [NotifyParentProperty(true),
        DefaultValue(true)]
        public bool ExportToPdf { get; set; }

        [NotifyParentProperty(true),
        DefaultValue(true)]
        public bool ExportToHtml { get; set; }
    }
}
